#!/usr/bin/env python3
"""
提示词管理系统启动脚本
"""

import os
import sys
from app import app, scheduler

def main():
    """主函数"""
    print("=" * 50)
    print("提示词管理系统")
    print("=" * 50)
    print(f"服务器地址: http://localhost:5000")
    print(f"数据库: {app.config['SQLALCHEMY_DATABASE_URI']}")
    print(f"同步间隔: {app.config['SYNC_INTERVAL']} 秒")
    print("=" * 50)
    print("按 Ctrl+C 停止服务器")
    print("=" * 50)
    
    try:
        app.run(
            host=app.config['API_HOST'],
            port=app.config['API_PORT'],
            debug=True
        )
    except KeyboardInterrupt:
        print("\n正在关闭服务器...")
        scheduler.shutdown()
        print("服务器已关闭")

if __name__ == '__main__':
    main()
